<template>
	<view class="content p15" style="margin-bottom: 60rpx;">
		<view class="card" v-if="type==1">
			<view class="flexb">
				<view class="cen">
					<view style="font-size: 28rpx;text-align: left;">累计巡边时长：{{data.time}}</view>
				</view>
			</view>
		</view>
		<view class="card" v-if="type==0">
			<view class="flexb">
				<view class="cen">
					<view style="font-size: 28rpx;text-align: left;">累计巡边次数：{{data.total}}</view>
				</view>
			</view>
		</view>
		<view class="card" v-if="type==2">
			<view class="flexb">
				<view class="cen">
					<view style="font-size: 28rpx;text-align: left;">累计巡边公里数：{{data.licheng.toFixed(2)}}Km</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import helper from '../../common/helper.js';
	import api from '../../common/api.js';
	export default {
		data() {
			return {
				data: [],
				type: 0,
			}
		},
		onLoad(op) {
			this.type = op.type
			this.onl()
		},
		methods: {
			async onl() {
				var _this = this;
				var res = await api.statistics({
					type: _this.type
				})
				if (res.code == 1) {
					_this.data = res.data;
				}
			},
			desc(id) {
				uni.navigateTo({
					url: '/pages/question/details?id=' + id
				})
			}
		}
	}
</script>

<style scoped>
	page {
		background-color: #EEF8FE;
	}

	.title {
		margin-top: 20rpx;
	}

	.card {
		box-shadow: 0rpx 0rpx 12rpx 4rpx #d1eeff;
		border-radius: 20rpx;
		padding: 30rpx;
		margin-top: 20rpx;
		background-color: #ffffff;
	}

	.color55 {
		color: #55535C;
	}

	.adress {
		border-top: 2rpx dashed #55535C;
		height: 74rpx;
		line-height: 74rpx;
		margin-top: 20rpx;
	}

	.icon {
		width: 40rpx;
		height: 40rpx;
		margin-right: 12rpx;
	}
</style>
